# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=plasma-remotecontrollers
pkgver=0_git20220306
pkgrel=1
_commit="da4623eed36d47193bab1a7e388ce410333c27b7"
pkgdesc="Translate various input device events into keyboard and pointer events"
url="https://invent.kde.org/plasma-bigscreen/plasma-remotecontrollers"
# armhf blocked by extra-cmake-modules
# s390x and riscv64 blocked by solid
arch="all !armhf !s390x !riscv64"
license="BSD-2-Clause AND (GPL-2.0-only OR GPL-3.0-only) AND CC0-1.0"
# For some reason there is no dep on so:libcec but it crashes without it
depends="libcec"
makedepends="
	extra-cmake-modules
	kconfig-dev
	knotifications-dev
	libcec-dev
	libevdev-dev
	qt5-qtbase-dev
	samurai
	solid-dev
	"
case "$CARCH" in
	ppc64le) ;;
	*) makedepends="$makedepends xwiimote-dev" ;;
esac
source="https://invent.kde.org/plasma-bigscreen/plasma-remotecontrollers/-/archive/$_commit/plasma-remotecontrollers-$_commit.tar.gz
	uinput.conf
	"
options="!check" # No tests
builddir="$srcdir/$pkgname-$_commit"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm644 \
		"$srcdir"/uinput.conf \
		-t "$pkgdir"/etc/modules-load.d
}

sha512sums="
7c86857237e8d601c4083f7b2b4a5d8eddc0bec01a22b01af73adbdbf28e2d591e7da0c962b00bc497ff95fcae59162d9842107fd190c25961d8119b20152a8a  plasma-remotecontrollers-da4623eed36d47193bab1a7e388ce410333c27b7.tar.gz
a9b069ed121ffeee887e0583d8cb46035ecf1fa90a26a4ecb3aa11ff03178b2b08621f6676db6b2350f290694c04aabcf36f2ce3e0813a76dde9a33555edb112  uinput.conf
"
